# -*- coding: utf-8 -*-
from common import orm
from decimal import Decimal

class CardStatisticsWeekly(orm.Model):
    __tablename__ = 'card_statistics_weekly'

    def __init__(self):
        self.card_code = ''
        self.total_amount = Decimal(0.00)
        self.collection_amount = Decimal(0.00)
        self.payment_amount = Decimal(0.00)
        self.manual_close_amount = Decimal(0.00)
        self.auto_close_amount = Decimal(0.00)
        self.processing_amount = Decimal(0.00)
        self.invalid_amount = Decimal(0.00)
        self.total_count = 0
        self.collection_count = 0
        self.payment_count = 0
        self.manual_close_count = 0
        self.auto_close_count = 0
        self.processing_count = 0
        self.invalid_count = 0

    id = orm.Column(orm.INTEGER, primary_key=True, autoincrement=True)
    card_code = orm.Column(orm.VARCHAR(25), nullable=False)
    total_amount = orm.Column(orm.FLOAT(32, 2), nullable=False, server_default=orm.text("'0.00'"))
    collection_amount = orm.Column(orm.FLOAT(32, 2), nullable=False, server_default=orm.text("'0.00'"))
    payment_amount = orm.Column(orm.FLOAT(32, 2), nullable=False, server_default=orm.text("'0.00'"))
    manual_close_amount = orm.Column(orm.FLOAT(32, 2), nullable=False, server_default=orm.text("'0.00'"))
    auto_close_amount = orm.Column(orm.FLOAT(32, 2), nullable=False, server_default=orm.text("'0.00'"))
    processing_amount = orm.Column(orm.FLOAT(32, 2), nullable=False, server_default=orm.text("'0.00'"))
    invalid_amount = orm.Column(orm.FLOAT(32, 2), nullable=False, server_default=orm.text("'0.00'"))
    total_count = orm.Column(orm.INTEGER, nullable=False, server_default=orm.text("'0'"))
    collection_count = orm.Column(orm.INTEGER, nullable=False, server_default=orm.text("'0'"))
    payment_count = orm.Column(orm.INTEGER, nullable=False, server_default=orm.text("'0'"))
    manual_close_count = orm.Column(orm.INTEGER, nullable=False, server_default=orm.text("'0'"))
    auto_close_count = orm.Column(orm.INTEGER, nullable=False, server_default=orm.text("'0'"))
    processing_count = orm.Column(orm.INTEGER, nullable=False, server_default=orm.text("'0'"))
    invalid_count = orm.Column(orm.INTEGER, nullable=False, server_default=orm.text("'0'"))
    created_at = orm.Column(orm.DateTime)
    updated_at = orm.Column(orm.DateTime)
